﻿using System.ComponentModel.Composition;
using Caliburn.Micro;
using OPSYS_Schematic.UIInfrastructure;

namespace OPSYS_Schematic.Presentation.Options
{
    [Export(typeof (IOptionPage))]
    public class LanguageOption : OptionPageBase
    {
        public LanguageOption()
            : base(WorkbenchName.LanguageOption)
        {
        }

        private string Lanaguage { get; set; }

        public void ChangeToChinese()
        {
            Lanaguage = "zh-cn";
        }

        public void ChangeToEnglish()
        {
            Lanaguage = "en-us";
        }

        public override void Commit()
        {
            IoC.Get<IResourceService>().ChangeLanguage(Lanaguage);
        }
    }
}